// scaup - Scala up!
// (c) 2008-2010, Normen Müller, normen.mueller@gmail.com  
// $Id: Parser.scala 51 2010-01-16 09:58:00Z normen.mueller $
package scaup.draft.parsing.eq

import java.io.File

import scala.util.parsing.combinator._
import scala.util.parsing.combinator.syntactical._

import scaup.Views._

private [eq] case class Element(val name: String, val scope: String, val annotations: Set[String], val constituents: Set[String])

/** An equivalence system parser.
 *
 * @author <a href="mailto:normen.mueller@googlemail.com">Normen M&#xFC;ller</a>
 * @version 0.0.3 */
private [eq] class Parser extends StdTokenParsers with ImplicitConversions {  
  /* Fill in abstract defs*/
  type Tokens = Lexer
  val lexical: Tokens = new Lexer
  
  /* Configure lexical parsing */                                 
  lexical.reserved ++= List( )
  
  lexical.delimiters ++= List( ) 
  
  /* Define the grammar */
//  lazy val eq: Parser[EquivalenceSpecification] = string ^^ {
//    case string =>
////      val elems : Set[Element] = Set()      
////      val tmp = (system /: elems)(_ + _)      
//
//      
////      (map /: elems)((m, e) => e match {
////        case Element(name, scope, annos, cons) =>
////          if (! (annos isEmpty))
////            m + {(
////              ((scope, name)),
////              new Equiv[String] { def equiv(x: String, y: String) = x == y }
////            )}
////          else m          
////      })
//      
//      null
//  }
  
  lazy val string = accept("string",  {case lexical.StringLit(n) => n mkString ("\"", "", "\"") })

}